Slack sink replies to a thread with holmes analysis#1799
Conversation
…usta into rob-944-channel-override
|
@coderabbitai please review |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chainI'll review the pull request for you, but first I need to gather some information about it to provide a meaningful review. 🏁 Script executed: Length of output: 9574 |
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
WalkthroughThe changes introduce a mechanism for propagating Slack thread and channel context through the action request and reporting pipeline. This is achieved by adding new context fields and classes, updating models, and modifying methods to handle and utilize this context. Documentation URLs in the Helm chart were also updated. Changes
Sequence Diagram(s)sequenceDiagram
participant Slack as Slack (User)
participant Receiver as Receiver
participant Action as Action Handler
participant Holmes as Holmes AI
participant Finding as Finding
participant Sender as SlackSender
Slack->>Receiver: Sends Slack action with channel_id, message_ts
Receiver->>Action: Calls __exec_external_request with action_params (includes robusta_context)
Action->>Holmes: ask_holmes(params with robusta_context)
Holmes->>Finding: Adds robusta_context to finding
Finding->>Sender: send_finding_to_slack(finding with robusta_context)
Sender->>Slack: Posts message to resolved channel/thread
sequenceDiagram
participant User as User
participant Receiver as Receiver
participant Action as Action Handler
User->>Receiver: Slack action (with slack_container)
Receiver->>Action: __exec_external_request
alt slack_container present
Receiver->>Action: Add robusta_context to action_params (thread_ts, channel_id)
end
Action->>...: Process action with context
Tip ⚡️ Faster reviews with caching
Enjoy the performance boost—your workflow just got faster. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms (2)
🔇 Additional comments (5)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
…usta into rob-944-channel-override
| thread_ts: Optional[str] = None, | ||
| ) -> tuple[str, Optional[str]]: | ||
|
|
||
| channel = ChannelTransformer.template( |
There was a problem hiding this comment.
A. Any reason to call this if channel override was provided?
B. Not sure i fully understand how this will work if ChannelTransformer.template will work correctly if labels & annotations aren't pass in that flow.
| [HolmesResultsBlock(holmes_result=holmes_result)], enrichment_type=EnrichmentType.ai_analysis | ||
| ) | ||
|
|
||
| runner_context = getattr(params, "robusta_context", None) |
There was a problem hiding this comment.
Looks like we are ignoring the sink param in this flow. It might cause issues with sending the finding to other sinks as well. I think we need to support the sink param in this flow as well.
| model: Optional[str] | ||
| # Additional internal context that helps runner to send investigation to appropriate sinks | ||
| # for now it is used only for passing thread_ts to slack sink internally; | ||
| robusta_context: Optional[Dict[str, Any]] = None |
There was a problem hiding this comment.
Thinking here loud, we already have SlackCallbackParams which being used in other flows. I think it will be good idea to add relevant info there and reuse in relevant flows.
WDYT?
Summary by CodeRabbit